* alloc.c: Remove unportable assumptions about struct layout.
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 18 Apr 2011 04:41:29 +0000 (21:41 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 18 Apr 2011 04:41:29 +0000 (21:41 -0700)
commit36372bf93fc75b5f85d04007268e98840d1699c5
treebd15d9623db1c58cbac99a5b3b40590fee8703c9
parentc7bda33cad5112de8c093dce0eaf62c84fb32063
* alloc.c: Remove unportable assumptions about struct layout.

(SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
(SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
(allocate_vectorlike, make_pure_vector): Use the new macros,
plus offsetof, to remove unportable assumptions about struct layout.
These assumptions hold on all porting targets that I know of, but
they are not guaranteed, they're easy to remove, and removing them
makes further changes easier.
src/ChangeLog
src/alloc.c