This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v3] Introduce gdb::unique_ptr


>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:

Pedro> For managing malloc pointers, this adds a gdb::unique_malloc_ptr<T>
Pedro> "specialization" with a custom xfree deleter.

I found something surprising while using this patch: it can't be used in
a .y file, due to the malloc->xmalloc renaming done in the .y.c rule.
I puzzled over the error about "unique_xmalloc_ptr" for a while until I
remembered this.

One option would be to fix up that renaming, maybe something like:

-	     -e 's/\([^x]\)malloc/\1xmalloc/g' \
-	     -e 's/\([^x_]\)malloc/\1xmalloc/g' \

Another would be to rename the class unique_xmalloc_ptr after all.

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]