Re: Does Bill Gates know about the DDK regarding C++?
- From: Mike Yoke <MikeYoke@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 9 Jun 2005 08:18:03 -0700
The allocator uses a low-memory handler that gets invoked in the event that
allocations from the private heap fail. The low-memory handler then acquires
more memory from the system via ExAllocatePool.
Mike
"Doron Holan [MS]" wrote:
> IIRC, the STL code didn't check the return results from an allocation. so
> you eliminated exceptions, but you didn't add any error handling. since
> allocs can fail, did you modify each STL container as well?
>
> --
> Please do not send e-mail directly to this alias. this alias is for
> newsgroup purposes only.
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
> "Mike Yoke" <MikeYoke@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:5BB17C3E-FAFA-4D38-A1D2-EAECFDE57FAB@xxxxxxxxxxxxxxxx
> > In my original post I said I used STL with a custom allocator written
> > explicitly for kernel mode use. It basically creates two private heaps at
> > driver load time, one paged and one non-paged, and manages all the small
> > allocations that STL tends to make out of this private heap. It also does
> > not
> > throw exceptions. Also, I studied the implementations of the containers
> > and
> > algorithms I chose to use to make sure I understood the code that was
> > being
> > generated.
> >
> > I don't advocate blind and careless use of C++ and STL in kernel mode, but
> > it can be used successfully.
> >
> > Mike
> >
> > "Doron Holan [MS]" wrote:
> >
> >> STL has no place in the kernel. it assumes allocations always succeed
> >> and
> >> upon failure, throw c++ exceptions. that just doesn't work in the kernel
> >> at
> >> all.
> >>
> >> d
> >>
> >> --
> >> Please do not send e-mail directly to this alias. this alias is for
> >> newsgroup purposes only.
> >> This posting is provided "AS IS" with no warranties, and confers no
> >> rights.
> >>
> >>
> >> "Don Burn" <burn@xxxxxxxxxxxxxxxx> wrote in message
> >> news:fdBpe.12948$mZ2.1718@xxxxxxxxxxx
> >> > Actually, I was trying to make it not a flame war. Note, I cautioned
> >> > against C++ but fully acknowledged people do it. I will emphatically
> >> > argue against STL in the kernel. You can use C++, but you need to
> >> > understand impacts for you and for people who pick up the code in the
> >> > future.
> >> >
> >> > I did not mention that WDF is written in C++ because it was
> >> > specifically
> >> > relavent. As I said a good expert can do it, and this is their choice,
> >> > particualarily if you have a team in place. Now I could have
> >> > mentioned,
> >> > that because of earlier statements about WDF being written in C++ I
> >> > know
> >> > of a consultant who has switched to the language without understanding
> >> > the
> >> > implications. His kernel code which was weak but ok, has now gone to
> >> > dog***.
> >> >
> >> >
> >> > --
> >> > Don Burn (MVP, Windows DDK)
> >> > Windows 2k/XP/2k3 Filesystem and Driver Consulting
> >> > Remove StopSpam from the email to reply
> >> >
> >> >
> >> >
> >> > "Robert Marquardt" <marquardt@xxxxxxxxxxxxx> wrote in message
> >> > news:OMjf$2%23aFHA.3100@xxxxxxxxxxxxxxxxxxxxxxx
> >> >> Mark Roddy wrote:
> >> >>
> >> >>> Don forgot to mention that WDF is written entirely in C++, except of
> >> >>> course for the exposed C api for us mere mortals. I rest my case.
> >> >>
> >> >> You are right. This is again a flame war.
> >> >> The original question was about APIs.
> >> >> APIs hould stay C APIs because C++ has no language agnostic interface.
> >> >>
> >> >> I personally dislike C++ for the very reason others praise it.
> >> >> The reason is "C++ is the richest language of all". This is precisely
> >> >> the
> >> >> problem. An average programmer does not master C++ fully resulting in
> >> >> bad
> >> >> programs.
> >> >> Java, Delphi and C# are popular becasue they all have less language
> >> >> features than C++ allowing average programmers to master them.
> >> >
> >> >
> >>
> >>
> >>
>
>
>
.
- Follow-Ups:
- Re: Does Bill Gates know about the DDK regarding C++?
- From: Doron Holan [MS]
- Re: Does Bill Gates know about the DDK regarding C++?
- References:
- Re: Does Bill Gates know about the DDK regarding C++?
- From: Robert Schlabbach
- Re: Does Bill Gates know about the DDK regarding C++?
- From: Mike Yoke
- Re: Does Bill Gates know about the DDK regarding C++?
- From: Don Burn
- Re: Does Bill Gates know about the DDK regarding C++?
- From: Mike Yoke
- Re: Does Bill Gates know about the DDK regarding C++?
- From: Don Burn
- Re: Does Bill Gates know about the DDK regarding C++?
- From: Mark Roddy
- Re: Does Bill Gates know about the DDK regarding C++?
- From: Robert Marquardt
- Re: Does Bill Gates know about the DDK regarding C++?
- From: Don Burn
- Re: Does Bill Gates know about the DDK regarding C++?
- From: Doron Holan [MS]
- Re: Does Bill Gates know about the DDK regarding C++?
- From: Mike Yoke
- Re: Does Bill Gates know about the DDK regarding C++?
- From: Doron Holan [MS]
- Re: Does Bill Gates know about the DDK regarding C++?
- Prev by Date: Printer Port Security problems
- Next by Date: USB Video Class driver of WinXP SP2 support black/white mode?
- Previous by thread: Re: Does Bill Gates know about the DDK regarding C++?
- Next by thread: Re: Does Bill Gates know about the DDK regarding C++?
- Index(es):
Loading