Commit cc0bc04 1 parent f77876a commit cc0bc04 Copy full SHA for cc0bc04
File tree 2 files changed +8
-10
lines changed
2 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -186,8 +186,11 @@ namespace alaska {
186
186
void ThreadCache::hfree (void *handle) {
187
187
alaska::Mapping *m = alaska::Mapping::from_handle_safe (handle);
188
188
if (unlikely (m == nullptr )) {
189
+
190
+ // printf("attempt to free non handle %p\n", handle);
189
191
bool worked = this ->runtime .heap .huge_allocator .free (handle);
190
- ALASKA_ASSERT (worked, " huge free failed" );
192
+ (void )worked;
193
+ // ALASKA_ASSERT(worked, "huge free failed");
191
194
return ;
192
195
}
193
196
// Free the allocation behind a mapping
@@ -199,7 +202,10 @@ namespace alaska {
199
202
200
203
201
204
size_t ThreadCache::get_size (void *handle) {
202
- alaska::Mapping *m = alaska::Mapping::from_handle (handle);
205
+ alaska::Mapping *m = alaska::Mapping::from_handle_safe (handle);
206
+ if (m == nullptr ) {
207
+ return this ->runtime .heap .huge_allocator .size_of (handle);
208
+ }
203
209
void *ptr = m->get_pointer ();
204
210
auto *page = this ->runtime .heap .pt .get_unaligned (ptr);
205
211
if (page == nullptr ) return this ->runtime .heap .huge_allocator .size_of (ptr);
Original file line number Diff line number Diff line change @@ -75,14 +75,6 @@ void hfree(void *ptr) {
75
75
// no-op if NULL is passed
76
76
if (unlikely (ptr == NULL )) return ;
77
77
78
- // Grab the Mapping
79
- auto *m = alaska::Mapping::from_handle_safe (ptr);
80
-
81
- // Not a handle? Pass it to the system allocator.
82
- if (unlikely (m == NULL )) {
83
- return ::free (ptr);
84
- }
85
-
86
78
// Simply ask the thread cache to free it!
87
79
get_tc ()->hfree (ptr);
88
80
}
You can’t perform that action at this time.
0 commit comments