diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 04749eccd18..e727bfb7b75 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2015-08-29 Patrick Palka + + * gdbtypes.c (alloc_type_arch): Allocate the type on the given + gdbarch obstack instead of on the heap. Update commentary + accordingly. + 2015-08-28 Joel Brobecker GDB 7.10 released. diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index 5c8e49c5d33..8204d39d185 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -187,7 +187,7 @@ alloc_type (struct objfile *objfile) /* Allocate a new GDBARCH-associated type structure and fill it with some defaults. Space for the type structure is allocated - on the heap. */ + on the obstack associated with GDBARCH. */ struct type * alloc_type_arch (struct gdbarch *gdbarch) @@ -198,8 +198,8 @@ alloc_type_arch (struct gdbarch *gdbarch) /* Alloc the structure and start off with all fields zeroed. */ - type = XCNEW (struct type); - TYPE_MAIN_TYPE (type) = XCNEW (struct main_type); + type = GDBARCH_OBSTACK_ZALLOC (gdbarch, struct type); + TYPE_MAIN_TYPE (type) = GDBARCH_OBSTACK_ZALLOC (gdbarch, struct main_type); TYPE_OBJFILE_OWNED (type) = 0; TYPE_OWNER (type).gdbarch = gdbarch;