Changeset 199934 in webkit
- Timestamp:
- Apr 22, 2016 4:25:54 PM (8 years ago)
- Location:
- trunk/Source/bmalloc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/bmalloc/ChangeLog
r199759 r199934 1 2016-04-22 Geoffrey Garen <ggaren@apple.com> 2 3 bmalloc: Constify introspect function pointer table 4 https://bugs.webkit.org/show_bug.cgi?id=156936 5 6 Reviewed by Michael Saboff. 7 8 * bmalloc/Zone.cpp: 9 (bmalloc::Zone::Zone): Declaring this function pointer table const puts 10 it in the read-only section of the binary, providing a little hardening 11 against overwriting the function pointers at runtime. (We have to 12 const_cast when assigning because the API declares a pointer to non-const, 13 but we happen to know it will never try to write through that pointer. 14 This is not my favorite API.) 15 1 16 2016-04-19 Geoffrey Garen <ggaren@apple.com> 2 17 -
trunk/Source/bmalloc/bmalloc/Zone.cpp
r198700 r199934 105 105 // constant in the program binary. The leaks process will load this struct 106 106 // out of the program binary (and not out of the running process). 107 static malloc_introspection_t zoneIntrospect = {107 static const malloc_introspection_t zoneIntrospect = { 108 108 .enumerator = bmalloc::enumerator, 109 109 .good_size = bmalloc::good_size, … … 120 120 malloc_zone_t::size = &bmalloc::zoneSize; 121 121 malloc_zone_t::zone_name = "WebKit Malloc"; 122 malloc_zone_t::introspect = &bmalloc::zoneIntrospect;122 malloc_zone_t::introspect = const_cast<malloc_introspection_t*>(&bmalloc::zoneIntrospect); 123 123 malloc_zone_t::version = 4; 124 124 malloc_zone_register(this);
Note: See TracChangeset
for help on using the changeset viewer.