Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARROW-238: Change InternalMemoryPool::Free() to return Status::Invalid when ther… #102

Closed
wants to merge 7 commits into from

Conversation

jihoonson
Copy link
Contributor

…e is insufficient memory.


virtual int64_t bytes_allocated() const = 0;
virtual uint64_t bytes_allocated() const = 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using unsigned integers has far more cons than pros. The Google C++ guide indicates that signed integers should almost always be used. See https://google.github.io/styleguide/cppguide.html#Integer_Types

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I've reverted this change.

@jihoonson jihoonson changed the title Change InternalMemoryPool::Free() to return Status::Invalid when ther… ARROW-238: Change InternalMemoryPool::Free() to return Status::Invalid when ther… Jul 12, 2016
@jihoonson
Copy link
Contributor Author

Unit testing seems to fail due to memory leak. I'll fix it soon.

@jihoonson
Copy link
Contributor Author

Broken test is fixed.

ASSERT_OK(pool->Allocate(100, &data));
EXPECT_EXIT(pool->Free(data, 120), ::testing::ExitedWithCode(1),
".*Check failed: \\(bytes_allocated_\\) >= \\(size\\)");
pool->Free(data, 100);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you disable this test for release builds? See the NDEBUG define in CMakeLists.txt

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your comment. Actually, I'm not an expert of C++, and would like to ask a question which may sound silly.
Does your comment mean that this unit test needs to be disabled for release builds? or, DCHECK in Free() should be disabled?
Would you please give me some backgrounds around this briefly?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/apache/arrow/blob/master/cpp/src/arrow/util/logging.h#L45

When compiled in release mode, the DCHECK statements are omitted. Thus, the unit test will not pass. You can try it yourself by passing -DCMAKE_BUILD_TYPE=release

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I disabled the test for release builds.

@wesm
Copy link
Member

wesm commented Jul 18, 2016

+1, thank you

@asfgit asfgit closed this in 55bfa83 Jul 18, 2016
@jihoonson
Copy link
Contributor Author

Thank you for your review.

wesm pushed a commit to wesm/arrow that referenced this pull request Sep 2, 2018
Also fixes few warnings in release mode build

Author: Deepak Majeti <deepak.majeti@hpe.com>

Closes apache#102 from majetideepak/ReleaseBuildErrors and squashes the following commits:

b54f126 [Deepak Majeti] added api to read additional column metadata
wesm pushed a commit to wesm/arrow that referenced this pull request Sep 4, 2018
Also fixes few warnings in release mode build

Author: Deepak Majeti <deepak.majeti@hpe.com>

Closes apache#102 from majetideepak/ReleaseBuildErrors and squashes the following commits:

b54f126 [Deepak Majeti] added api to read additional column metadata

Change-Id: Iddf193def450c092090a95758f27c1dcad87185a
wesm pushed a commit to wesm/arrow that referenced this pull request Sep 6, 2018
Also fixes few warnings in release mode build

Author: Deepak Majeti <deepak.majeti@hpe.com>

Closes apache#102 from majetideepak/ReleaseBuildErrors and squashes the following commits:

b54f126 [Deepak Majeti] added api to read additional column metadata

Change-Id: Iddf193def450c092090a95758f27c1dcad87185a
wesm pushed a commit to wesm/arrow that referenced this pull request Sep 7, 2018
Also fixes few warnings in release mode build

Author: Deepak Majeti <deepak.majeti@hpe.com>

Closes apache#102 from majetideepak/ReleaseBuildErrors and squashes the following commits:

b54f126 [Deepak Majeti] added api to read additional column metadata

Change-Id: Iddf193def450c092090a95758f27c1dcad87185a
wesm pushed a commit to wesm/arrow that referenced this pull request Sep 8, 2018
Also fixes few warnings in release mode build

Author: Deepak Majeti <deepak.majeti@hpe.com>

Closes apache#102 from majetideepak/ReleaseBuildErrors and squashes the following commits:

b54f126 [Deepak Majeti] added api to read additional column metadata

Change-Id: Iddf193def450c092090a95758f27c1dcad87185a
zhouyuan pushed a commit to zhouyuan/arrow that referenced this pull request May 17, 2022
…r substr_index (apache#102)

* Fix a tiny issue

* Implement substr_index in a func. holder

* Fix compile issue

* Fix other compile issues

* Fix unit test issue

* Fix bugs found in tests

* Add some checks in ut
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants